{$layout}

<!-- 检测配置是否有更新 begins -->
<div class="ui icon message warning" v-if="statusChanged">
    <i class="exclamation circle icon large"></i>
    代理服务已被修改，<a href="" v-on:click.prevent="restart()">点此重启后生效</a>
</div>

{$var "header"}
<script type="text/javascript" src="/_/@default/proxy/@global.js"></script>
{$end}
<!--  检测配置是否有更新 end -->

<div>
    {$template "/proxy/menu"}

    {$template "menu"}

    <form class="ui form">
        <!-- 基本信息 -->
        <h3>基本信息 <a :href="'/proxy/locations/update?server=' + proxy.filename + '&locationId=' + location.id + '&from=' + from">修改</a></h3>
        <table class="ui table selectable definition ">
            <tr>
                <td>是否启用</td>
                <td>
                    <span v-if="location.on" class="ui label green tiny">启用中</span>
                    <span v-if="!location.on" class="ui label tiny">未启用</span>
                </td>
            </tr>
            <tr>
                <td class="title">规则<em>(Pattern)</em></td>
                <td>{{location.pattern}}</td>
            </tr>
            <tr>
                <td>规则类型</td>
                <td v-if="location.type == 1">匹配前缀</td>
                <td v-if="location.type == 2">精准匹配</td>
                <td v-if="location.type == 3">正则表达式匹配</td>
            </tr>
            <tr>
                <td>文档根目录<em>(Root)</em></td>
                <td>
                    <span style="word-break: break-all;" v-if="location.root.length > 0">{{location.root}}</span>
                    <a class="disabled" v-if="location.root.length == 0">还没有设置。</a>
                </td>
            </tr>
            <tr>
                <td>字符编码<em>(Charset)</em></td>
                <td>
                    <span v-if="location.charset.length > 0">{{location.charset}}</span>
                    <a class="disabled" v-if="location.charset.length == 0">还没有设置。</a>
                </td>
            </tr>
        </table>

        <h3>特殊设置 <a :href="'/proxy/locations/update?server=' + proxy.filename + '&locationId=' + location.id + '&showSpecial=1&from=' + from">修改</a></h3>
        <table class="ui table selectable definition">
            <tr>
                <td class="title">反向匹配</td>
                <td colspan="2">
                    <span class="ui label green tiny" v-if="location.reverse">已启用</span>
                    <span class="ui label tiny" v-if="!location.reverse">未启用</span>
                </td>
            </tr>
            <tr>
                <td>不区分大小写</td>
                <td colspan="2">
                    <span class="ui label green tiny" v-if="location.caseInsensitive">已启用</span>
                    <span class="ui label tiny" v-if="!location.caseInsensitive">未启用</span>
                </td>
            </tr>
        </table>
    </form>
</div>